#FROM php:7.1.20-fpm-alpine3.7
FROM php:7.1.33-fpm-alpine3.10
MAINTAINER <1370808424@qq.com>slpcode
# 安装php扩展
#RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories \
#    && apk upgrade \
Run apk upgrade \
    && apk add --no-cache tzdata git \
    icu-dev gettext-dev libxml2-dev \
    libmcrypt-dev libjpeg-turbo-dev libpng-dev freetype-dev autoconf g++ make imagemagick imagemagick-dev libmemcached libmemcached-dev \
    openssl openssl-dev \
    && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
    && apk del tzdata

RUN docker-php-ext-install bcmath exif gettext intl pcntl shmop soap sockets sysvmsg sysvsem sysvshm zip iconv mcrypt pdo_mysql mysqli \
    && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/ \
    && docker-php-ext-install gd

RUN pecl install xdebug-2.6.0 \
RUN pecl channel-update pecl.php.net \
    && pecl install mongodb-1.11.1 \
    && pecl install imagick \
    && pecl install swoole-4.5.11 \
    && pecl install redis \
    && pecl install memcached \
    && docker-php-ext-enable xdebug \
    && docker-php-ext-enable mongodb \
    && docker-php-ext-enable swoole \
    && docker-php-ext-enable imagick \
    && docker-php-ext-enable redis \
    && docker-php-ext-enable memcached

#RUN curl -fsSL 'https://github.com/wcgallego/pecl-gearman/archive/gearman-2.0.6.tar.gz' -o gearman.tar.gz \
#    && mkdir -p gearman \
#    && tar -xf gearman.tar.gz -C gearman --strip-components=1 \
#    && rm gearman.tar.gz \
#    && ( \
#        cd gearman \
#        && phpize \
#        && ./configure --enable-gearman \
#        && make -j "$(nproc)" \
#        && make install \
#    ) \
#    && rm -r gearman \
#    && docker-php-ext-enable gearman

COPY --from=composer /usr/bin/composer /usr/bin/composer

ENV PATH $PATH:/composer71/vendor/bin
ENV COMPOSER_HOME /composer71

RUN mkdir /composer71 \
#    && /usr/bin/composer selfupdate \
    && /usr/bin/composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ \
    && composer global require symfony/var-dumper -vvv
